/**
* Copyright @ 2023 iAuto (Shanghai) Co., Ltd.
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are NOT permitted except as agreed by
* iAuto (Shanghai) Co., Ltd.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/



import {
  BaseApiResponse,
  SoaDetailParams,
  SoaDetailResult,
  SoaListParams,
  PublishDelParams,
} from '@/types/soaSocType';
import { Methods } from '@/types/soaSocType';
import request from '../utils/request';

// 服务列表
export async function getSocList(payload: SoaListParams) {
  // return request<BaseApiResponse<SocListResult>>(`/api/ms-soa-service/v1/admin/carmodel/soc/list`, {
  return request<BaseApiResponse<any>>(`/api/ms-soa-service/v1/admin/carmodel/soc/list`, {
    method: Methods.GET,
    params: payload,
  });
}

// 删除
export async function delVersion(payload: PublishDelParams) {
  return request(`/api/ms-soa-service/v1/admin/carmodel/soc/del`, {
    method: Methods.POST,
    data: payload,
  });
}
// 发布
export async function publishVersion(payload: PublishDelParams) {
  return request(`/api/ms-soa-service/v1/admin/carmodel/soc/publish`, {
    method: Methods.POST,
    data: payload,
  });
}

// 服务详情
export async function getSoaDetail(payload: SoaDetailParams) {
  return request<BaseApiResponse<SoaDetailResult>>(`/api/ms-soa-service/v1/admin/service/detail`, {
    method: Methods.GET,
    params: payload,
  });
}
